#include "dataconfig.h"

DataConfig::DataConfig(QObject *parent) : QObject(parent)
{
    //存储地图数据
    QVector<QVector<int>> vec;
    //1代表墙，2代表草皮，3代表僵尸，4代表樱桃炸弹，6代表df
    //第一关配置数据
    int arr1[15][15]={
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,
        0,0,0,0,1,1,1,3,2,6,1,0,0,0,0,
        0,0,0,0,1,2,4,2,4,2,1,0,0,0,0,
        0,0,0,0,1,2,2,2,4,2,1,0,0,0,0,
        0,0,0,0,1,3,3,1,2,2,1,0,0,0,0,
        0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
        };
    for(int i=0; i<15; i++)
    {
        QVector<int> vec1;
        for(int j=0; j<15; j++)
        {
            vec1.push_back(arr1[i][j]);
        }
        vec.push_back(vec1);
    }
    mData.insert(1,vec);

    //第二关配置数据
    vec.clear();//先清空
    int arr2[15][15]={
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,
        0,0,0,0,1,2,2,3,3,3,1,0,0,0,0,
        0,0,0,0,1,2,2,2,1,1,1,1,0,0,0,
        0,0,0,1,1,1,4,2,2,2,2,1,0,0,0,
        0,0,0,1,2,2,2,1,4,1,2,1,0,0,0,
        0,0,0,1,2,4,2,1,6,2,2,1,0,0,0,
        0,0,0,1,2,2,2,1,1,1,1,1,0,0,0,
        0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    };
    for(int i=0; i<15; i++)
    {
        QVector<int> vec1;
        for(int j=0; j<15; j++)
        {
            vec1.push_back(arr2[i][j]);
        }
        vec.push_back(vec1);
    }
    mData.insert(2,vec);

    //第三关配置数据
    vec.clear();//先清空
    int arr3[15][15]={
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,
        0,1,1,1,1,2,2,2,2,2,1,0,0,0,0,
        0,1,2,2,2,3,1,1,1,2,1,0,0,0,0,
        0,1,2,1,2,1,2,2,2,2,1,1,0,0,0,
        0,1,2,1,2,4,2,4,1,3,2,1,0,0,0,
        0,1,2,1,2,2,5,2,2,1,2,1,0,0,0,
        0,1,2,3,1,4,2,4,2,1,2,1,0,0,0,
        0,1,1,2,2,2,2,1,2,1,2,1,1,1,0,
        0,0,1,2,1,1,1,3,2,2,6,2,2,1,0,
        0,0,1,2,2,2,2,2,1,1,2,2,2,1,0,
        0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    };
    for(int i=0; i<15; i++)
    {
        QVector<int> vec1;
        for(int j=0; j<15; j++)
        {
            vec1.push_back(arr3[i][j]);
        }
        vec.push_back(vec1);
    }
    mData.insert(3,vec);

    //第四关配置数据
    vec.clear();//先清空
    int arr4[15][15]={
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,
        0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,
        0,0,0,1,1,1,5,2,1,1,1,1,0,0,0,
        0,0,0,1,2,2,4,2,2,4,2,1,0,0,0,
        0,0,0,1,2,3,4,3,2,1,2,1,0,0,0,
        0,0,0,1,6,1,2,1,2,1,2,1,0,0,0,
        0,0,0,1,2,3,4,3,2,2,2,1,0,0,0,
        0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    };
    for(int i=0; i<15; i++)
    {
        QVector<int> vec1;
        for(int j=0; j<15; j++)
        {
            vec1.push_back(arr4[i][j]);
        }
        vec.push_back(vec1);
    }
    mData.insert(4,vec);
}
